package org.example.Command;

import lombok.Data;

import java.io.Serializable;
import java.util.HashMap;


@Data
public class CommonMessage extends Message implements Serializable {
    private static final long serialVersionUID = 3L;
    String msg;

    public static final String END = "end";

    HashMap<String, String> args;

    public CommonMessage(String msg) {
        super(COMMON_MESSAGE, 0);
        this.msg = msg;
    }

    public CommonMessage(String msg, Integer sequenceId) {
        super(COMMON_MESSAGE, sequenceId);
        this.msg = msg;
    }

    //获取约定的本次交互结束的指令。
    public static CommonMessage getEnd(Integer sequenceId) {
        return new CommonMessage(END, sequenceId);
    }
}
